const joi = require('joi');

const vote_log_id = joi.number().required();

const vote_text = joi.string().required();
const vote_creator_id = joi.number().required();
const vote_creator_date = joi.date().required();
const vote_start_date = joi.date().required();
const vote_end_date = joi.date().required();

const vote_option_id = joi.number().required();
const user_id = joi.number().required();
const vote_person_date = joi.date().required();

const idea_text = joi.string().required();
const idea_creator_id = joi.number().required();
const idea_creation_date = joi.date().required();

const idea_log_id = joi.number().required();
const idea_agree_person_id = joi.number().required();
const idea_agree_date = joi.date().required();

// 发布投票
exports.add_vote_schema = {
	body: {
		vote_text,
		vote_creator_id,
		vote_creator_date,
		vote_start_date,
		vote_end_date
	}
}

// 进行投票
exports.cast_vote_schema = {
	body: {
		vote_option_id,
		user_id,
		vote_person_date
	}
}

// 删除投票
exports.delete_vote_schema = {
	body: {
		vote_log_id
	}
}

// 发布意见
exports.add_idea_schema = {
	body: {
		idea_text,
		idea_creator_id,
		idea_creation_date
	}
}

// 赞同意见
exports.agree_idea_schema = {
	body: {
		idea_log_id,
		idea_agree_person_id,
		idea_agree_date
	}
}